<?xml version="1.0" encoding="UTF-8"?>
<html filename="docs/BSAXExt/IBufferedLexicalHandler.html">
<body>
<a id="#top"/>
<h1>
	                Interface Summary : IBufferedLexicalHandler </h1> SAX2 extension handler for lexical events.

 <blockquote>
 <em>This module, both source code and documentation, is in the
 Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
 </blockquote>

 <p>This is an optional extension handler for SAX2 to provide
 lexical information about an XML document, such as comments
 and CDATA section boundaries.
 XML readers are not required to recognize this handler, and it
 is not part of core-only SAX2 distributions.</p>

 <p>The events in the lexical handler apply to the entire document,
 not just to the document element, and all lexical handler events
 must appear between the content handler's startDocument and
 endDocument events.</p>

 <p>To set the LexicalHandler for an XML reader, use the
 <a href="../BSAX/IBufferedXMLReader.html#getProperty">getProperty</a> method
 with the property name
 <code>http://xml.org/sax/properties/lexical-handler</code>
 and an object implementing this interface (or nil) as the value.
 If the reader does not report lexical events, it will throw a
 <a href="../SAX/ESAXNotRecognizedException.html">ESAXNotRecognizedException</a>
 when you attempt to register the handler.</p>

 <p>For reasons of generality and efficiency, strings that are returned
 from the interface are declared as pointers (PSAXChar) and lengths.
 This requires that the model use procedural out parameters rather
 than functions as in the original interfaces.</p>

<br/><b>Since : </b> SAX 2.0 (extensions 1.0)
<h2>
	              Methods
	            </h2>
<div style="padding-left:10px">
<a href="#startDTD">
	                  procedure
	                 startDTD(PSAXChar, Integer, PSAXChar, Integer, PSAXChar, Integer)</a>
<br/>
<a href="#endDTD">
	                  procedure
	                 endDTD()</a>
<br/>
<a href="#startEntity">
	                  procedure
	                 startEntity(PSAXChar, Integer)</a>
<br/>
<a href="#endEntity">
	                  procedure
	                 endEntity(PSAXChar, Integer)</a>
<br/>
<a href="#startCDATA">
	                  procedure
	                 startCDATA()</a>
<br/>
<a href="#endCDATA">
	                  procedure
	                 endCDATA()</a>
<br/>
<a href="#comment">
	                  procedure
	                 comment(PSAXChar, Integer)</a>
<br/>
</div>
<br/>
<hr width="100%"/>
<a name="#startDTD">
<p>
<b>procedure</b> startDTD( name : PSAXChar;  nameLength : Integer;  publicId : PSAXChar;  publicIdLength : Integer;  systemId : PSAXChar;  systemIdLength : Integer); </p>
</a> Report the start of DTD declarations, if any.

 <p>This method is intended to report the beginning of the
 DOCTYPE declaration; if the document has no DOCTYPE declaration,
 this method will not be invoked.</p>

 <p>All declarations reported through
 <a href="../BSAX/IBufferedDTDHandler.html">IBufferedDTDHandler</a> or
 <a href="../BSAXExt/IBufferedDeclHandler.html">IBufferedDeclHandler</a> events must appear
 between the startDTD and <a href="../BSAXExt/IBufferedLexicalHandler.html#endDTD">endDTD</a> events.
 Declarations are assumed to belong to the internal DTD subset
 unless they appear between <a href="../BSAXExt/IBufferedLexicalHandler.html#startEntity">startEntity</a>
 and <a href="../BSAXExt/IBufferedLexicalHandler.html#endEntity">endEntity</a> events.  Comments and
 processing instructions from the DTD should also be reported
 between the startDTD and endDTD events, in their original
 order of (logical) occurrence; they are not required to
 appear in their correct locations relative to DTDHandler
 or DeclHandler events, however.</p>

 <p>Note that the start/endDTD events will appear within
 the start/endDocument events from IContentHandler and
 before the first
 <a href="../BSAX/IBufferedContentHandler.html#startElement">startElement</a>
 event.</p>

<br/><b>Parameter : </b> name The document type name.
<br/><b>Parameter : </b> nameLength The length of the name buffer.
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Parameter : </b> publicId The declared public identifier for the
        external DTD subset, or an empty string if none was declared.
<br/><b>Parameter : </b> publicIdLength The length of the publicId buffer.
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Parameter : </b> systemId The declared system identifier for the
        external DTD subset, or an empty string if none was declared.
        (Note that this is not resolved against the document
        base URI.)
<br/><b>Parameter : </b> systemIdLength The length of the systemId buffer.
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Exception : </b> ESAXException The application may raise an
            exception.
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#endDTD">IBufferedLexicalHandler.endDTD</a>
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#startEntity">IBufferedLexicalHandler.startEntity</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#endDTD">
<p>
<b>procedure</b> endDTD(); </p>
</a> Report the end of DTD declarations.

 <p>This method is intended to report the end of the
 DOCTYPE declaration; if the document has no DOCTYPE declaration,
 this method will not be invoked.</p>

<br/><b>Exception : </b> ESAXException The application may raise an exception.
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#startDTD">IBufferedLexicalHandler.startDTD</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#startEntity">
<p>
<b>procedure</b> startEntity( name : PSAXChar;  nameLength : Integer); </p>
</a> Report the beginning of some internal and external XML entities.

 <p>The reporting of parameter entities (including
 the external DTD subset) is optional, and SAX2 drivers that
 report IBufferedLexicalHandler events may not implement it; you can use the
 <code>http://xml.org/sax/features/lexical-handler/parameter-entities</code>
 feature to query or control the reporting of parameter entities.</p>

 <p>General entities are reported with their regular names,
 parameter entities have '%' prepended to their names, and
 the external DTD subset has the pseudo-entity name &quot;[dtd]&quot;.</p>

 <p>When a SAX2 driver is providing these events, all other
 events must be properly nested within start/end entity
 events.  There is no additional requirement that events from
 <a href="../BSAXExt/IBufferedDeclHandler.html">IBufferedDeclHandler</a> or
 <a href="../BSAX/IBufferedDTDHandler.html">IBufferedDTDHandler</a> be properly ordered.</p>

 <p>Note that skipped entities will be reported through the
 <a href="../BSAX/IBufferedContentHandler.html#skippedEntity">skippedEntity</a>
 event, which is part of the IContentHandler interface.</p>

 <p>Because of the streaming event model that SAX uses, some
 entity boundaries cannot be reported under any
 circumstances:</p>

 <ul>
 <li>general entities within attribute values</li>
 <li>parameter entities within declarations</li>
 </ul>

 <p>These will be silently expanded, with no indication of where
 the original entity boundaries were.</p>

 <p>Note also that the boundaries of character references (which
 are not really entities anyway) are not reported.</p>

 <p>All start/endEntity events must be properly nested.</p>

<br/><b>Parameter : </b> name The name of the entity.  If it is a parameter
        entity, the name will begin with '%', and if it is the
        external DTD subset, it will be '[dtd]'.
<br/><b>Parameter : </b> nameLength The length of the name buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Exception : </b> SAXException The application may raise an exception.
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#endEntity">IBufferedLexicalHandler.endEntity</a>
<br/><b>See : </b> <a href="../BSAXExt/IBufferedDeclHandler.html#internalEntityDecl">IBufferedDeclHandler.internalEntityDecl</a>
<br/><b>See : </b> <a href="../BSAXExt/IBufferedDeclHandler.html#externalEntityDecl">IBufferedDeclHandler.externalEntityDecl</a>
/
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#endEntity">
<p>
<b>procedure</b> endEntity( name : PSAXChar;  nameLength : Integer); </p>
</a> Report the end of an entity.

<br/><b>Parameter : </b> name The name of the entity that is ending.
<br/><b>Parameter : </b> nameLength The length of the name buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Exception : </b> ESAXException The application may raise an exception.
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#startEntity">IBufferedLexicalHandler.startEntity</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#startCDATA">
<p>
<b>procedure</b> startCDATA(); </p>
</a> Report the start of a CDATA section.

 <p>The contents of the CDATA section will be reported through
 the regular <a href="../BSAX/IBufferedContentHandler.html#characters">characters</a>
 event; this event is intended only to report
 the boundary.</p>

<br/><b>Exception : </b> ESAXException The application may raise an exception.
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#endCDATA">IBufferedLexicalHandler.endCDATA</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#endCDATA">
<p>
<b>procedure</b> endCDATA(); </p>
</a> Report the end of a CDATA section.

<br/><b>Exception : </b> ESAXException The application may raise an exception.
<br/><b>See : </b> <a href="../BSAXExt/IBufferedLexicalHandler.html#startCDATA">IBufferedLexicalHandler.startCDATA</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#comment">
<p>
<b>procedure</b> comment( ch : PSAXChar;  chLength : Integer); </p>
</a> Report an XML comment anywhere in the document.

 <p>This callback will be used for comments inside or outside the
 document element, including comments in the external DTD
 subset (if read).  Comments in the DTD must be properly
 nested inside start/endDTD and start/endEntity events (if
 used).</p>

<br/><b>Parameter : </b> ch An array holding the characters in the comment.
<br/><b>Parameter : </b> chLength The length of the ch buffer
   The value may be -1 which indicates that the buffer is
   null-terminated. If the value is 0 then the buffer may be nil.
<br/><b>Exception : </b> ESAXException The application may raise an exception.
<br/>
<p>
<a href="#top">Top</a>
</p>
</body>
</html>